package com.androidx.p013lv.base.recycler;

import android.graphics.Rect;
import android.view.View;
import androidx.recyclerview.widget.RecyclerView;

/* renamed from: com.androidx.lv.base.recycler.RxRecyclerViewDividerTool */
public class RxRecyclerViewDividerTool extends RecyclerView.ItemDecoration {
    private int bottomSpace = 0;
    private boolean isTop = false;
    private int leftSpace = 0;
    private int rightSpace = 0;
    private int space = 0;
    private int topSpace = 0;

    /* renamed from: aa */
    public void mo13222aa() {
    }

    public RxRecyclerViewDividerTool(int i, int i2, int i3, int i4) {
        this.leftSpace = i;
        this.rightSpace = i2;
        this.topSpace = i3;
        this.bottomSpace = i4;
    }

    public RxRecyclerViewDividerTool(int i, int i2, int i3, int i4, boolean z) {
        this.leftSpace = i;
        this.rightSpace = i2;
        this.topSpace = i3;
        this.bottomSpace = i4;
        this.isTop = z;
    }

    public RxRecyclerViewDividerTool(int i, boolean z) {
        this.space = i;
        this.isTop = z;
    }

    public RxRecyclerViewDividerTool(int i) {
        this.space = i;
    }

    @Override // androidx.recyclerview.widget.RecyclerView.ItemDecoration
    public void getItemOffsets(Rect rect, View view, RecyclerView recyclerView, RecyclerView.State state) {
        int i = this.space;
        if (i == 0) {
            rect.left = this.leftSpace;
            rect.right = this.rightSpace;
            rect.bottom = this.topSpace;
            rect.top = this.bottomSpace;
        } else {
            rect.left = i;
            rect.right = this.space;
            rect.bottom = this.space;
            rect.top = this.space;
        }
        if (this.isTop && recyclerView.getChildLayoutPosition(view) == 0) {
            rect.top = 0;
            rect.left = 0;
            rect.right = 0;
        }
    }
}
